package com.baidu;

import lombok.Data;
import org.springframework.stereotype.Component;

import java.util.Objects;

@Data
@Component("Car")
public class Car {
    public String name;
    public Integer price;
    public Engine engine;

    public Car(String name, Integer price, Engine engine) {
        this.name = name;
        this.price = price;
        this.engine = engine;
    }

    public Car() {
    }

    @Override
    public String toString() {
        return "Car{" +
                "name='" + name + '\'' +
                ", price=" + price +
                ", engine=" + engine +
                '}';
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    public Engine getEngine() {
        return engine;
    }

    public void setEngine(Engine engine) {
        this.engine = engine;
    }


    public void init() {
        System.out.println("TestBean的初始化方法");
    }

    public void destroy() {
        System.out.println("TestBean的销毁方法");
    }

}

